Cache heights-for-range-of-widths instead of height for every width.
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Sun, 6 Mar 2011 06:13:56 +0000 (15:13 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Fri, 25 Mar 2011 09:42:08 +0000 (18:42 +0900)
commit38b5c8cf45e53ced9fd617332cdaf3a87601d451
tree9855e9adbbc7661af342af43c26964dcfa8a2d63
parent82ae7b77cafad6c9370eb2d6ec56b14731147928
Cache heights-for-range-of-widths instead of height for every width.

This patch optimizes window resizes by assuming that if a widget
has the same height at a width of 50 as with a width of 150, the
height for width 100 will also be the same.

The patch also further optimizes the cache allocator, now there
are 2 pointer arrays of up to a maximum of 5 requests, the arrays
will only be allocated if a request is ever made in that orientation
and the array will be sparse until each request is made (i.e. if a
label can only wrap to 3 lines, there will only be 3 out of a
possible 5 SizeRequest structures allocated to cache it).
gtk/gtksizerequest.c
gtk/gtkwidget.c
gtk/gtkwidgetprivate.h